package com.ysd.lis.controller.qi;


import com.ysd.common.Result;
import com.ysd.lis.annotation.LogDetail;
import com.ysd.lis.aspect.OperationType;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.qi.QiIndexMajor;
import com.ysd.lis.service.qi.QiIndexMajorService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 质量指标专业 前端控制器
 * </p>
 *
 * @author LiuQi
 * @since 2024-02-03
 */
@Api(tags = "质量指标专业")
@RestController
@RequestMapping("/api/qi/qiIndexMajor")
public class QiIndexMajorController extends BaseController {

    @Autowired
    QiIndexMajorService qiIndexMajorService;

    @ApiOperation("获取专业列表")
    @GetMapping("/getIndexMajorList/{indexCode}")
    public Result getIndexMajorList(@PathVariable("indexCode") String indexCode) {
        return qiIndexMajorService.getIndexMajorList(indexCode);
    }

    @ApiOperation("添加指标专业")
    @PostMapping("/addQiIndexMajor")
    @LogDetail(requestParam ="addQiIndexMajor",operationType = OperationType.INSERT, module = "添加指标专业",content = "增加【majorName】指标专业", businessName = "majorName")
    public Result addQiIndexMajor(@RequestBody QiIndexMajor qiIndexMajor) {
        return qiIndexMajorService.addQiIndexMajor(qiIndexMajor);
    }
    @ApiOperation("添加指标专业")
    @PostMapping("/addQiIndexMajorList")
    @LogDetail(requestParam ="addQiIndexMajor",operationType = OperationType.INSERT, module = "添加指标专业",content = "增加【majorName】指标专业", businessName = "majorName")
    public Result addQiIndexMajorList(@RequestBody List<QiIndexMajor> qiIndexMajor) {
        return qiIndexMajorService.addQiIndexMajorList(qiIndexMajor);
    }

    @ApiOperation("编辑指标专业")
    @PostMapping("/updateQiIndexMajor")
    @LogDetail(requestParam ="updateQiIndexMajor",operationType = OperationType.UPDATE, module = "编辑指标专业",content = "编辑【majorName】指标专业", businessName = "majorName")
    public Result updateQiIndexMajor(@RequestBody QiIndexMajor qiIndexMajor) {
        return qiIndexMajorService.updateQiIndexMajor(qiIndexMajor);
    }

    @ApiOperation("删除指标专业")
    @PostMapping("/deleteQiIndexMajor")
    @LogDetail(requestParam ="deleteQiIndexMajor",operationType = OperationType.DELETE, module = "删除指标专业",content = "删除【majorName】指标专业", businessName = "majorName")
    public Result deleteQiIndexMajor(@RequestBody QiIndexMajor qiIndexMajor) {
        return qiIndexMajorService.deleteQiIndexMajor(qiIndexMajor);
    }
}
